package com.csci;
import java.awt.GridLayout;
import javax.swing.JPanel;

public class SudokuMainPanel {
	int dimension;
	int sqrtDimension;
	JPanel mainPanel;
	SudokuBoxPanel[][] sudokuBoxPanel;
	
	public SudokuMainPanel(int dimension, int[][][] boxPanel) {
		this.dimension = dimension;
		this.sqrtDimension = (int)Math.sqrt(dimension);
		mainPanel = new JPanel(new GridLayout(sqrtDimension, sqrtDimension));
		initializeMainPanel();
	}

	public void initializeMainPanel() {
		sudokuBoxPanel = new SudokuBoxPanel[sqrtDimension][sqrtDimension];
		for(int row = 0; row < sqrtDimension; row++){
			for(int col = 0; col < sqrtDimension; col++) {
				sudokuBoxPanel[row][col] = new SudokuBoxPanel(sqrtDimension, null);
				mainPanel.add(sudokuBoxPanel[row][col].boxPanel);
			}
		}
	}
	
}
